using System;
using System.Collections.Generic;
using System.Xml;
using System.Text;

namespace GURUCORE.Portal.Core.RSS
{
    public class RSS_Item
    {
        public string title;
        public string link;
        public string description;
        /// <summary>
        /// lawyer@boyer.net (Lawyer Boyer)
        /// </summary>
        public string author;
        public string category;
        /// <summary>
        /// http://ekzemplo.com/entry/4403/comments
        /// </summary>
        public string comments;
        /// <summary>
        /// <enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" />
        /// </summary>
        public string enclosure;
        /// <summary>
        /// http://some.server.com/weblogItem3207
        /// </summary>
        public string guid;
        /// <summary>
        /// Sun, 19 May 2002 15:21:36 GMT
        /// </summary>
        public string pubDate;
        /// <summary>
        /// <source url="http://www.tomalak.org/links2.xml">Tomalak's Realm</source>
        /// </summary>
        public string source;

        public void WriteTo(XmlWriter writer)
        {
            writer.WriteStartElement("", "item", "");
            writer.WriteStartElement("", "title", ""); writer.WriteString(title); writer.WriteEndElement();
            writer.WriteStartElement("", "link", ""); writer.WriteString(link); writer.WriteEndElement();
            writer.WriteStartElement("", "description", ""); writer.WriteString(description); writer.WriteEndElement();
            writer.WriteStartElement("", "author", ""); writer.WriteString(author); writer.WriteEndElement();
            writer.WriteStartElement("", "category", ""); writer.WriteString(category); writer.WriteEndElement();
            writer.WriteStartElement("", "comments", ""); writer.WriteString(comments); writer.WriteEndElement();
            writer.WriteStartElement("", "enclosure", ""); writer.WriteString(enclosure); writer.WriteEndElement();
            writer.WriteStartElement("", "guid", ""); writer.WriteString(guid); writer.WriteEndElement();
            writer.WriteStartElement("", "pubDate", ""); writer.WriteString(pubDate); writer.WriteEndElement();

            writer.WriteStartElement("", "source", "");
            writer.WriteAttributeString("url", "http://gurucore.com");
            writer.WriteString(source);
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
    }
}
